package net.xxcl.zcgl.core;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import net.xxcl.zcgl.service.PaperService;
import org.springframework.context.ApplicationContext;

import org.springframework.web.context.support.WebApplicationContextUtils;

public class CtxListener implements ServletContextListener {
    private static ApplicationContext ctx;

    public static ApplicationContext getCtx() {
        return ctx;
    }

    public void contextInitialized(ServletContextEvent sce) {
        CtxListener.ctx = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext());
    }

    public void contextDestroyed(ServletContextEvent sce) {
    }
}
